package com.cheng.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheng.common.exception.CommonException;
import com.cheng.common.utils.StringUtil;
import com.cheng.data.entity.TradeTypeInfEntity;
import com.cheng.data.mapper.TradeTypeInfMapper;
import com.cheng.service.TradeTypeInfService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: ChengJW
 * @date: 2021/11/8 20:23
 * @version: 1.0
 * @description: 有关 trade_type_inf 表操作
 */
@Service
public class TradeTypeInfServiceImpl implements TradeTypeInfService {

    private final static Logger log = LoggerFactory.getLogger(TradeTypeInfServiceImpl.class);

    @Autowired
    private TradeTypeInfMapper tradeTypeInfMapper;

    /**
     * @author: ChengJW
     * @params: []
     * @return: java.util.List<com.cheng.data.entity.TradeTypeInfEntity>
     * @date: 2021/11/8
     * @description: 查询 trade_type_inf 列表信息
     */
    @Override
    public List<TradeTypeInfEntity> queryTradeTypeInf(TradeTypeInfEntity entity) throws CommonException {

        QueryWrapper<TradeTypeInfEntity> wrapper = new QueryWrapper<>();
        wrapper.eq(StringUtil.isNotNull(entity.getTeTypeCode()),"te_type_code",entity.getTeTypeCode());
        return tradeTypeInfMapper.selectList(wrapper);
    }
}
